from django.urls import path,re_path
from .import views
from rest_framework.routers import DefaultRouter
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [
    # path
    re_path('^usernames/(?P<username>\w{5,20})/count/$', views.UsernameCountView.as_view()),
    re_path('^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),
    re_path('^sms_codes/(?P<mobile>1[3-9]\d{9})/$', views.SMSCodeView.as_view()),

    path('users/', views.UserView.as_view()),  # 用户注册路由

    path('authorizations/', obtain_jwt_token),   # token路由

    # UserDetailView
    path('user/', views.UserDetailView.as_view()),   # 用户信息路由(个人中心)

    path('email/', views.EmailView.as_view()),   # 邮箱路由

    path('emails/verification/', views.VerifyEmailView.as_view()),   # 邮箱验证路由

    path('password/',views.SavePassword.as_view()),  #修改密码路由

    path('browse_histories/',views.SKUHistoriesView.as_view()),

]
# AreasViewSet
router = DefaultRouter()
router.register('areas', views.AreasViewSet, basename='areas')
router.register('addresses', views.AddressViewSet, basename='addresses')
urlpatterns += router.urls

"""
{
  "registry-mirrors": [
    "https://docker.registry.cyou",
    "https://docker-cf.registry.cyou",
    "https://dockercf.jsdelivr.fyi",
    "https://docker.jsdelivr.fyi",
    "https://dockertest.jsdelivr.fyi",
    "https://mirror.aliyuncs.com",
    "https://dockerproxy.com",
    "https://mirror.baidubce.com",
    "https://docker.m.daocloud.io",
    "https://docker.nju.edu.cn",
    "https://docker.mirrors.sjtug.sjtu.edu.cn",
    "https://docker.mirrors.ustc.edu.cn",
    "https://mirror.iscas.ac.cn",
    "https://docker.rainbond.cc",
  ]
}




"""